-
-
Notifications
You must be signed in to change notification settings - Fork 432
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Log warnings when an Item's semantic structure is incorrect #4613
base: main
Are you sure you want to change the base?
Conversation
@rkoshak FYI. I'd like to tag JustinG too but I don't know his github name. |
This pull request has been mentioned on openHAB Community. There might be relevant details there: https://community.openhab.org/t/openhab-5-semantic-model-proposal/162526/61 |
57c1e31
to
59920f1
Compare
@jimtng This is very interesting. Note that I put in logic to validate model changes in the PR for model drag drop: openhab/openhab-webui#2970 Seeing the checks you have here, it looks like I have missed the special cases (point in equipment with also location set on that item). I may have to make a slight change to support that, but first want to get the main cases reviewed and supported there. I. Am just wondering if there would be a more intelligent way to keep these rules in sync. But then again, the logic must be in the UI (and not a REST call check), as this would be impossible for checks during the drag action. |
@JustinGeorgi is Justin's Github tag.
I like this idea.
Maybe just add to the message why this is being logged.
I don't know if that's any better. |
I'm trying to avoid mentioning "problem", in the case when it's intentional.
I'm more referring to all the other messages I came up above, so if you have other suggestions, I'd like to hear them.
I see, that it's tricky, primarily that it would be slow to have to call REST every time you do a test against potential drop target, not to mention caching issues. Perhaps it's easier to just duplicate the logic and write a comment in the UI code to refer to the core code? I didn't even think about the drag and drop code, and more about just displaying a red warning / icon on the item or model page. So maybe your code could be written so the validation can be called there too. Alternatively it can be refactored later. |
This pull request has been mentioned on openHAB Community. There might be relevant details there: https://community.openhab.org/t/configuration-of-multiple-items/162674/7 |
Signed-off-by: Jimmy Tanagra <[email protected]>
59920f1
to
24642e1
Compare
That was the only one that stood out. |
Shouldn't the warning go also to Health Checks provided by the UI ? |
See discussion in https://community.openhab.org/t/openhab-5-semantic-model-proposal/162526/21
Sample log messages at
WARN
levelA Point that belongs to an Equipment and a Location will generate an
INFO
log. This allows user to set the log level to WARN to not see them.May require better wording to more accurately convey the meaning.